package com.mybed.crm.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mybed.crm.common.enums.HttpCodeEnum;
import com.mybed.crm.mapper.ActivityMapper;
import com.mybed.crm.pojo.dto.PageActivityDto;
import com.mybed.crm.pojo.pojo.Activity;
import com.mybed.crm.pojo.vo.ActivityVo;
import com.mybed.crm.result.PageResult;
import com.mybed.crm.service.ActivityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.http.client.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> implements ActivityService {

    @Autowired
    private ActivityMapper activityMapper;

    @Override
    public int add(Activity activity) {
        activity.setCreateTime(LocalDateTime.now());
        activity.setBeginTime(LocalDateTime.now());
        activity.setCode(activity.getCode());
        activity.setStatus(activity.getStatus());
        int rows = activityMapper.insert(activity);
        // loadAllActivityCode();
        return rows;
    }

}
